//
//  JSTNavgationController.m
//  KYKJPackDemo
//
//  Created by 01 on 16/12/14.
//  Copyright © 2016年 蔡正军. All rights reserved.
//

#import "JSTNavgationController.h"
#import "JSTStartView.h"
#import "JSTTableScreenView.h"

@interface JSTNavgationController ()

@end

@implementation JSTNavgationController

+ (JSTNavgationController *)shareNavCtl
{
    static JSTNavgationController *jstNavCtl = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        jstNavCtl = [[JSTNavgationController alloc] init];
    });
    return jstNavCtl;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void) createNotification
{
    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange) name:UIDeviceOrientationDidChangeNotification object:nil];
}

- (BOOL)shouldAutorotate
{
    return [self.viewControllers.lastObject shouldAutorotate];
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_9_0
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return [self.viewControllers.lastObject preferredInterfaceOrientationForPresentation];
}

@end
